home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Resource for Source: C/C++
/
Resource for Source - C-C++.iso
/
codelib4
/
v_06_03
/
v6n3011a.txt
< prev
next >
Wrap
Text File
|
1995-11-01
|
679b
|
33 lines
char *strlower(string)
/* Transforms all characters in string to lower case */
char *string; /* String to transform */
{
char *pc;
/* Save the starting address */
pc = string;
while (*string)
{
if (isupper(*string))
*string = tolower(*string);
string++;
}
return pc;
}
Why not just:
while (*string)
{
*string = tolower(*string);
string++;
}
Personally I prefer:
for (; *string; string++)
*string = tolower(*string);